import dayjs from 'dayjs'
import { API_LIST } from '../../../Api/Api'
import { commonTableList, BuiltInData } from '../Common/common'
import { SelectExcelButton } from '../Common/options'

export const PersonKQData = async ({ url, OptionsEvent, ClientData, Permission, actionRef }) => {
    let data = {
        pageSize: 1000,
        params: { pageIndex: 1 },
        get: API_LIST()[`getAttendanceRenZiList`],
        added: `pos${url}`,
        modify: `put${url}`,
        delete: `del${url}`,
        options: [
            <SelectExcelButton
                key="excel1"
                title="导出数据"
                OptionsEvent={OptionsEvent}
                api={API_LIST()['getAttendanceRenZiExcel']}
            />,
        ],
        columns: [
            commonTableList.uuid,
            {
                dataIndex: 'year',
                title: '年份',
                valueType: 'inputNumber',
                width: 150,
                hideInTable: true,
                initialValue: dayjs().format('YYYY'),
            },
            {
                dataIndex: 'number',
                title: '月份',
                valueType: 'select',
                valueEnum: BuiltInData.monthList,
                width: 150,
                hideInTable: true,
                initialValue: dayjs().format('M'),
            },
            {
                dataIndex: '日期',
                title: '日期',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '姓名',
                title: '姓名',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
            },
            {
                dataIndex: '部门',
                title: '部门',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '状态',
                title: '状态',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '出勤天数',
                title: '出勤天数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '出差天数',
                title: '出差天数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '事假天数',
                title: '事假天数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '病假天数',
                title: '病假天数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '婚假天数',
                title: '婚假天数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '丧假天数',
                title: '丧假天数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '产假天数',
                title: '产假天数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '年假天数',
                title: '年假天数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '早退次数',
                title: '早退次数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '缺卡次数',
                title: '缺卡次数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '补卡次数',
                title: '补卡次数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
            {
                dataIndex: '迟到次数',
                title: '迟到次数',
                valueType: 'input',
                ellipsis: true,
                rules: true,
                width: 150,
                hideInSearch: true,
            },
        ],
    }

    return data
}
